home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / AMBER-Journeys Beyond™ demo / AMBER-Journeys Beyond™ demo.DXR / 00006.ls < prev    next >
Encoding:
Text File  |  1996-10-17  |  3.7 KB  |  121 lines

  1. on enterFrame
  2.   global gAmberPath, gSavePath, gProjectorPath, fastLocationData, gCPU, gCDtry, testData, gMaxCDtries
  3.   set gMaxCDtries to 4
  4.   if voidp(gCDtry) then
  5.     set gCDtry to 1
  6.   end if
  7.   put "gCDtry = " & gCDtry
  8.   if gCPU = #PC then
  9.     openXLib("LABELDRV.DLL")
  10.     set ld to labelDrv(mnew)
  11.     put ld(mSetRange, "A", "Z")
  12.     if gCDtry <= gMaxCDtries then
  13.       set cdLetter to ld(mGetDrive, "AMBER_DISC1")
  14.       put "cdLetter = "
  15.       put cdLetter
  16.       if charToNum(char 1 of cdLetter) <> 0 then
  17.         set gAmberPath to char 1 to 2 of cdLetter & "\"
  18.         put "gAmberPath = "
  19.         put gAmberPath
  20.       else
  21.         put "bad string"
  22.         if gCDtry < gMaxCDtries then
  23.           alert("Please insert the " & QUOTE & "AMBER_DISC1" & QUOTE & " CD into any drive")
  24.         else
  25.           alert("Sorry, the CD doesn't seem to be mounted")
  26.         end if
  27.       end if
  28.     end if
  29.     if gCDtry = gMaxCDtries then
  30.       put "gAmberPath =" & gAmberPath
  31.       if voidp(gAmberPath) then
  32.         put "final volumeTest = "
  33.         put cdLetter
  34.         put "OK, now I'd really quit.."
  35.         clearGlobals()
  36.         quit()
  37.       end if
  38.     end if
  39.     put ld(mdispose)
  40.     closeXLib("LABELDRV.DLL")
  41.   else
  42.     openXLib("AMBER resources")
  43.     if 1 then
  44.       set gAmberPath to the pathName
  45.     else
  46.       if gCDtry <= gMaxCDtries then
  47.         set volumeTest to FileIO(mnew, "read", "AMBER-Journeys Beyond‚Ñ¢ (B):Read Me")
  48.         if objectp(volumeTest) then
  49.           volumeTest(mdispose)
  50.           set gAmberPath to "AMBER-Journeys Beyond‚Ñ¢ (B):"
  51.         else
  52.           if integerp(volumeTest) then
  53.             put "[!] fileIO error -> " & FileIO(mError, volumeTest)
  54.             if getPos([-35, -120, -43], volumeTest) <> 0 then
  55.               if gCDtry < gMaxCDtries then
  56.                 set tempCDobject to AppleCD(mnew)
  57.                 tempCDobject(mEject)
  58.                 alert("Please insert the " & QUOTE & "AMBER-Journeys Beyond‚Ñ¢ Disc B" & QUOTE & " CD into any drive")
  59.               else
  60.                 alert("Sorry, there is an error in trying to find the CD:" & RETURN & RETURN & "   '" & FileIO(mError, volumeTest) & "'")
  61.               end if
  62.             else
  63.               alert("Sorry, there is an error in trying to find the CD:" & RETURN & RETURN & "   '" & FileIO(mError, volumeTest) & "'")
  64.             end if
  65.           else
  66.             alert("Sorry, there is an unknown error in trying to find the CD")
  67.           end if
  68.         end if
  69.       end if
  70.       if gCDtry = gMaxCDtries then
  71.         put "gAmberPath =" & gAmberPath
  72.         if voidp(gAmberPath) then
  73.           put "final volumeTest = "
  74.           put volumeTest
  75.           clearGlobals()
  76.           quit()
  77.         end if
  78.       end if
  79.     end if
  80.     closeXLib("AMBER resources")
  81.   end if
  82.   set gCDtry to gCDtry + 1
  83.   set gProjectorPath to the pathName
  84.   if stringp(gAmberPath) then
  85.     set oldDelim to the itemDelimiter
  86.     set the itemDelimiter to ":"
  87.     set the itemDelimiter to oldDelim
  88.   end if
  89.   if gCPU = #PC then
  90.     set gSavePath to the pathName & "SAVEDATA\"
  91.   else
  92.     set gSavePath to the pathName & "saved games:"
  93.   end if
  94.   set fastLocationData to 1
  95. end
  96.  
  97. on exitFrame
  98.   global gAmberPath, gMaxCDtries, gCDtry, gCPU, gProjectorPath
  99.   if voidp(gAmberPath) then
  100.     if gCDtry <= gMaxCDtries then
  101.       if integerp(gCDtry) then
  102.         go(the frame)
  103.       end if
  104.       return 
  105.     else
  106.       exit
  107.     end if
  108.   end if
  109.   append(the searchPath, gAmberPath)
  110.   if gCPU = #PC then
  111.     set tempSoundPath to gProjectorPath & "GAMEDATA\"
  112.     set logoPath to gAmberPath & "ROXY\MOVIES\"
  113.   else
  114.     set tempSoundPath to gProjectorPath & "sounds etc.:"
  115.     set logoPath to gAmberPath & "ROXY:movies:"
  116.   end if
  117.   append(the searchPath, tempSoundPath)
  118.   append(the searchPath, logoPath)
  119.   go(1, "AMBERHUB")
  120. end
  121.